'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.createTable('uploads', {
      id: {
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: Sequelize.INTEGER,
      },
      filename: {
        allowNull: false,
        type: Sequelize.STRING,
        comment: '文件名称，包含后缀',
      },
      mimetype: {
        allowNull: false,
        type: Sequelize.STRING,
        comment: '文件类型',
      },
      destination: {
        allowNull: false,
        type: Sequelize.STRING,
        comment: '文件目录',
      },
      path: {
        allowNull: false,
        type: Sequelize.STRING,
        comment: '文件路径',
      },
      size: {
        allowNull: false,
        type: Sequelize.INTEGER,
        comment: '文件大小，字节',
      },
      deleted_at: {
        type: Sequelize.DATE,
      },
      created_at: {
        allowNull: false,
        type: Sequelize.DATE,
      },
      updated_at: {
        allowNull: false,
        type: Sequelize.DATE,
      },
    });
  },
  async down(queryInterface, Sequelize) {
    await queryInterface.dropTable('uploads');
  },
};
